<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
            const arrs = [
                { id: 1, username: "张三", userage: 18, num: 3 },
            ]
            const res = []
            console.log("arrs",arrs)
            arrs.forEach((item, index) => {
                for (var i = 0; i < item.num; i++) {
                res.push({
                    ...item,
                    id: i + 1
                })
                }
            })
            const resDataList = JSON.parse(JSON.stringify(res))
            console.log("resData",resDataList)
    </script>
</body>
</html>